<div class="row justify-content-center">
    <div class="col-8">
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" [formGroup]="editForm">
            <h2 id="jhi-user-content-comment-heading" jhiTranslate="server181102App.userContentComment.home.createOrEditLabel">Create or edit a User Content Comment</h2>

            <div>
                <jhi-alert-error></jhi-alert-error>

                <div class="form-group" [hidden]="!editForm.get('id')!.value">
                    <label for="id" jhiTranslate="global.field.id">ID</label>
                    <input type="text" class="form-control" id="id" name="id" formControlName="id" readonly />
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="server181102App.userContentComment.commentPid" for="field_commentPid" [ngbTooltip]="'server181102App.userContentComment.help.commentPid' | translate">Comment Pid</label>
                    <input type="number" class="form-control" name="commentPid" id="field_commentPid"
                           formControlName="commentPid"/>
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="server181102App.userContentComment.commentTime" for="field_commentTime" [ngbTooltip]="'server181102App.userContentComment.help.commentTime' | translate">Comment Time</label>
                    <div class="d-flex">
                        <input id="field_commentTime" type="datetime-local" class="form-control" name="commentTime" formControlName="commentTime" placeholder="YYYY-MM-DD HH:mm"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="server181102App.userContentComment.commentContent" for="field_commentContent" [ngbTooltip]="'server181102App.userContentComment.help.commentContent' | translate">Comment Content</label>
                    <input type="text" class="form-control" name="commentContent" id="field_commentContent"
                           formControlName="commentContent"/>
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="server181102App.userContentComment.clientType" for="field_clientType" [ngbTooltip]="'server181102App.userContentComment.help.clientType' | translate">Client Type</label>
                    <input type="text" class="form-control" name="clientType" id="field_clientType"
                           formControlName="clientType"/>
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="server181102App.userContentComment.praiseCount" for="field_praiseCount" [ngbTooltip]="'server181102App.userContentComment.help.praiseCount' | translate">Praise Count</label>
                    <input type="number" class="form-control" name="praiseCount" id="field_praiseCount"
                           formControlName="praiseCount"/>
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="server181102App.userContentComment.account" for="field_account">Account</label>
                    <select class="form-control" id="field_account" name="account" formControlName="account">
                        <option [ngValue]="null"></option>
                        <option [ngValue]="userAccountOption.id === editForm.get('account')!.value?.id ? editForm.get('account')!.value : userAccountOption" *ngFor="let userAccountOption of useraccounts; trackBy: trackById">{{ userAccountOption.id }}</option>
                    </select>
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="server181102App.userContentComment.content" for="field_content">Content</label>
                    <select class="form-control" id="field_content" name="content" formControlName="content">
                        <option [ngValue]="null"></option>
                        <option [ngValue]="contentInfoOption.id === editForm.get('content')!.value?.id ? editForm.get('content')!.value : contentInfoOption" *ngFor="let contentInfoOption of contentinfos; trackBy: trackById">{{ contentInfoOption.id }}</option>
                    </select>
                </div>
            </div>

            <div>
                <button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
                    <fa-icon icon="ban"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
                </button>

                <button type="submit" id="save-entity" [disabled]="editForm.invalid || isSaving" class="btn btn-primary">
                    <fa-icon icon="save"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
                </button>
            </div>
        </form>
    </div>
</div>
